<style>
    .el-input__inner,
    .el-cascader {
        line-height: 30px !important;
        height: 30px !important;
    }
</style>
<div class="rightcontent rc-bg-grey">
    <div class="rc-pagepadding">

        <div class="rc-pannel rc-searchbox">
            <form class="layui-form " method="get">
                <div class="rc-flex-vertical-center rc-searchbox">
                    <div class="layui-inline ">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="title" placeholder="" value="<?php echo request()->get('title', ''); ?>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline ">
                        <label class="layui-form-label">手机</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="title" placeholder="" value="<?php echo request()->get('title', ''); ?>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline ">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="title" placeholder="" value="<?php echo request()->get('title', ''); ?>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline ">
                        <label class="layui-form-label">单位</label>
                        <div class="layui-input-inline ">
                            <?php echo element('organcascader', name: 'organcompanyid'); ?>
                        </div>
                    </div>

                    <div class="layui-inline ">
                        <label class="layui-form-label">岗位</label>
                        <div class="layui-input-inline ">
                            <?php echo element('organpost', name: 'organpostid'); ?>
                        </div>
                    </div>


                    <div class="layui-inline">
                        <div class="layui-form-label">
                            <button type="submit" class="layui-btn layui-btn-sm layui-btn-primary"><i class="iconfont">&#xeafe;</i> 搜索</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>


        <div class=" rc-pannel rc-margin-top-default">
            <div class=" rc-pannel-header">
                <div class="rc-flex layui-form toolbar rc-flex-justify-between">
                    <div class=" rc-flex rc-flex-vertical-center ">

                    </div>
                    <div>
                        <a href="/admin/cnf/OrganPost/add" class="layui-btn layui-btn-primary layui-btn-sm"><i class="iconfont">&#xe60e;</i> 添加管理员</a>

                    </div>
                </div>


            </div>


            <div class="rc-pannel-body layui-form rc-pagepadding">

                <table class="layui-table">
                    <colgroup>
                        <col>
                        <col>
                        <col style="width: 240px;">

                    </colgroup>
                    <thead>
                        <tr>
                            <th>用户名</th>
                            <th>管理员类型</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php foreach ($admins as $key => $admin) {
                        ?>

                            <tr>
                                <td>
                                    <?php echo $admin->username; ?>
                                </td>
                                <td>
                                    站点普通管理员
                                </td>
                                <td>
                                    <div class="rc-opbar" style="width: 150px;margin-left:15px">
                                        <a class="info " href="/admin/cnf/OrganPost/edit?id=<?php echo $admin->id ?>"> <i class="iconfont">&#xe643;</i> 资料</a>
                                        <a class="info " href="/admin/cnf/OrganPost/edit?id=<?php echo $admin->id ?>"> <i class="iconfont">&#xe643;</i> 权限</a>
                                    </div>
                                </td>
                            </tr>
                        <?php
                        } ?>
                    </tbody>
                </table>
            </div>

            <div class="rc-pannel-footer">
                <div class="pagebar" id="pagebar" style="text-align: right;">
                    <?php echo paginator($admins->total(), 20)
                    ?>
                </div>

            </div>
        </div>
    </div>
</div>
<script>
    layui.use(function() {

        var layer = layui.layer;

        $('.delete').click(function() {
            var postid = $(this).attr('postid');
            layer.confirm('确定要删除么？', {
                icon: 3
            }, function() {
                $.ajax({
                    url: '/admin/cnf/OrganPost/delete?id=' + postid, //请求路径
                    type: "POST", //请求方式
                    success: function(data) {
                        if (data.code == 0) {
                            window.location.reload();
                        } else {
                            toastr_error(data.message);
                        }
                        layer.closeAll();
                    },
                    error: function() {
                        layer.closeAll();
                    },

                });


            }, function() {



            });

        });

    });
</script>